#include <iostream>
#include "list.h"
#include <vector>
#include <string>
using namespace std;


class Solution {
public:
	vector<string> letterCombinations(string digits) {
		vector<string> character = { "0", "1", "abc", "def", "ghi", "jkl"
								"mno","pqrs", "tuv","wxyz" };
		vector<string> ret;

		size_t groups;
		for (size_t i = 0; i < digits.size(); i++)
		{
			string s1 = character[digits[i]];
			groups *= s1.size();
		}

		for (size_t i = 0; i < groups; i++)
		{

		}
	}
};


int main()
{
	txp::list<int> l1({ 1,2,3,4,5,6 });
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;

	return 0;
}

int main5()
{
	txp::list<int> l1(8, 8);
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;

	txp::list<int> l2 = l1;
	for (auto e : l2)
	{
		cout << e << " ";
	}
	cout << endl;

	txp::list<int> l3 = l2;
	for (auto e : l3)
	{
		cout << e << " ";
	}
	cout << endl;

	return 0;
}

int main4()
{
	txp::list<int> l1(6, 8);
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;

	l1.push_back(2);
	l1.push_back(3);
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;

	auto it = l1.begin();
	l1.insert(it + 2, 99);
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;

	l1.erase(it + 2);
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;

	l1.pop_front();
	l1.pop_front();
	l1.pop_front();
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;

	l1.pop_back();
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;

	l1.push_front(99);
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;

	l1.clear();
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << "end" << endl;

	return 0;
}

int main3()
{
	const txp:: list<int> l1(10, 2);
	/*for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;*/

	txp::list<int>::const_iterator cit = l1.begin();
	while (cit != l1.end())
	{
		cout << *cit << " ";
		++cit;
	}
	cout << endl;

	return 0;
}


struct Pos
{
	Pos(int row = 0, int col = 0)
		:_row(row)
		,_col(col)
	{}

	int _row;
	int _col;
};

int main2()
{
	txp::list<Pos> l1;
	l1.push_back(Pos(2, 3));
	l1.push_back(Pos(3, 4));

	auto it = l1.begin();
	while (it != l1.end())
	{
		//cout << (*it)._row << ":" << (*it)._col << endl;
		cout << it->_row << ":" << it->_col << endl;
		++it;
	}

	return 0;
}


int main1()
{
	txp::list<int> l1;
	l1.push_back(1);
	l1.push_back(2);
	l1.push_back(3);
	l1.push_back(4);

	txp::list<int>::iterator it = l1.begin();
	while (it != l1.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;

	for (auto& e : l1)
	{
		cout << e << " ";
	}
	cout << endl;

	return 0;
}